<?php
namespace app\api\validate\service;

use think\Validate;

class Goods extends Validate
{
    protected $rule =   [
        'name'               => 'require',
        'category_id'        => 'require',
        'shop_id'            => 'require',
        'tag_name'           => 'require',
        'skill_cate_ids'     => 'require',
        'response_hour'      => 'require',
        'price'              => 'require|gt:0',
        'image'              => 'require',
        'images'             => 'require',
        'flow_path_images'   => 'require',
        'illustrate_images'  => 'require',
    ];

    protected $message  =   [
        'name.require'             => '请填写项目名称',
        'shop_id.require'          => '商家信息缺失',
        'category_id.require'      => '项目分类必须选择',
        'skill_cate_ids.require'   => '服务技能必须选择',
        'response_hour.require'    => '响应时间必须填写',
        'price.require'            => '价格必须填写',
        'price.gt'                 => '价格必须大于0',
        'image.require'            => '项目主图必须上传',
        'images.require'           => '轮播图必须上传',
        'tag_name.require'         => '请填写项目标签',
        'flow_path_images.require' => '服务流程必须上传',
        'illustrate_images.require'=> '服务说明必须上传',
    ];

    protected $scene = [
        'edit'  =>  ['name','category_id','skill_cate_ids','images','response_hour','image','flow_path_images','illustrate_images','price'],
        'add'   =>  ['name','category_id','skill_cate_ids','images','response_hour','image','flow_path_images','illustrate_images','price'],
    ];
}
